// 拟合评估
<template>
  <div class="tableAuto">
    <el-table :data="tableData" style="width:100%" :height="height" @row-click="rowClick" border stripe
      :header-cell-style="{background:'#EAEBEC'}" v-loading="tableLoading" ref="refTable" highlight-current-row @sort-change='sortChange'>
      <el-table-column prop="level0" min-width="160" show-overflow-tooltip label="数据记录数"></el-table-column>
      <el-table-column prop="wll" width="160" show-overflow-tooltip label="R平方"></el-table-column>
      <el-table-column prop="zdpl" width="160" show-overflow-tooltip label="调整R平方"></el-table-column>

      <el-table-column prop="srz" width="160" show-overflow-tooltip label="似然值"></el-table-column>
      <el-table-column prop="aic" width="120" show-overflow-tooltip label="AIC"></el-table-column>
      <el-table-column prop="bic" width="120" show-overflow-tooltip label="BIC"></el-table-column>
      <el-table-column prop="dwz" width="120" show-overflow-tooltip label="DW值"></el-table-column>
      <el-table-column prop="ssyz" width="120" show-overflow-tooltip label="收缩因子"></el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  data () {
    return {
      radioId: "",
      height: document.body.offsetHeight - 210,
      tableData: [
        { 'level0': '55', 'wll': 0.85141943371435591, 'zdpl': 0.845592744840409, 'fengsu': 21, 'wendu': 33, 'sfhl': 26, 'zdplfc': 980, 'srz': -352.521, 'aic': '711.0092', 'bic': '711.0422', 'dwz': '1.752', 'ssyz': '1' },
        { 'level0': '55', 'wll': 0.79758022372235138, 'zdpl': 0.78964219328009067, 'fengsu': 21, 'wendu': 33, 'sfhl': 27, 'zdplfc': 970, 'srz': .521, 'aic': '711.0092', 'bic': '711.0422', 'dwz': '1.752', 'ssyz': '1' },
        // { 'level0': '55', 'wll': 3, 'zdpl': 12, 'fengsu': 21, 'wendu': 33, 'sfhl': 28, 'zdplfc': 960 },
        // { 'level0': '55', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 35, 'sfhl': 22, 'zdplfc': 998 },
        // { 'level0': '55', 'wll': 3, 'zdpl': 11, 'fengsu': 25, 'wendu': 36, 'sfhl': 22, 'zdplfc': 997 },
        // { 'level0': '55', 'wll': 3, 'zdpl': 11, 'fengsu': 26, 'wendu': 37, 'sfhl': 22, 'zdplfc': 996 },
      ],
      wrList: [{
        label: "读写",
        value: 0
      }, {
        label: "只读",
        value: 1
      }, {
        label: "只写",
        value: 2
      }],
    }
  },
  props: {
    // tableData: Array,
    // pager: Object,
    tableLoading: Boolean
  },
  onCreated () {
    // this.tableData = [
    //   { 'level0': '', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 33, 'sfhl': 22, 'zdplfc': 990 },
    //   { 'level0': '', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 33, 'sfhl': 22, 'zdplfc': 990 },
    //   { 'level0': '', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 33, 'sfhl': 22, 'zdplfc': 990 },
    //   { 'level0': '', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 33, 'sfhl': 22, 'zdplfc': 990 },
    //   { 'level0': '', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 33, 'sfhl': 22, 'zdplfc': 990 },
    //   { 'level0': '', 'wll': 3, 'zdpl': 11, 'fengsu': 21, 'wendu': 33, 'sfhl': 22, 'zdplfc': 990 },
    // ]
  },
  methods: {
    rowClick (row) {
      this.radioId = row.woId;
      let obj = {
        row: row,
        radioId: this.radioId,
      }
      this.$emit("handleEdit", obj)
      this.$refs.refTable.setCurrentRow(row);
    },
    sortChange (column) {
      this.$emit('sortChange', column)
    },
    table_index (index) {
      // return (this.pager.pageNum - 1) * this.pager.pageSize + index
    },
    getwrName (id) {
      if (!id && id !== 0) return ''
      return this.wrList.find(item => parseInt(item.value) == id).label
    },

  }
}
</script>
<style scoped>
.bai {
  color: #fff;
}
.tableAuto {
  margin-top: 10px;
}
</style>